Texture2D    tex0;
SamplerState smp0;

cbuffer CBuffer
{
	float4 color;
	float4 eye;

	float4x4 world;
    float4x4 view;
	float4x4 pers;
	float4x4 orth;
}

struct VOut
{
    float4 pos : SV_POSITION;
	float4 clr : COLOR0;
	float2 tex : TEXCOORD0;
};

VOut VShader_Homogeneous(
	float4 pos : POSITION0,
	float2 tex : TEXCOORD0)
{
    VOut output;

    output.pos = pos;
	output.tex = tex;
	output.clr = color;

    return output;
}

VOut VShader_Orthogonal(
	float4 pos : POSITION0,
	float2 tex : TEXCOORD0)
{
    VOut output;

	output.pos = mul(orth,mul(world,pos));
	output.tex = tex;
	output.clr = color;

    return output;
}

VOut VShader_Perspective(
	float4 pos : POSITION0,
	float2 tex : TEXCOORD0)
{
    VOut output;

	output.pos = mul(pers,mul(view,mul(world,pos)));
	output.tex = tex;
	output.clr = color;

    return output;
}

float4 PShader_Color(VOut input) : SV_TARGET
{
	return input.clr;
}

float4 PShader_Texture(VOut input) : SV_TARGET
{
    return input.clr*tex0.Sample(smp0,input.tex);
}